import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-05-18
 * Time: 10:53
 */
public class Test004 {
    public static void main(String[] args) {
        int n;
        try (Scanner sc = new Scanner(System.in)) {
            n = sc.nextInt();
        }
        int sum=0;
        for (int i = 1; i <=n; i++) {
            int tem=1;
            for (int j = 1; j <=i; j++) {
                tem*=j;
            }
            sum+=tem;
        }
        System.out.println(sum);
    }
}
